java puzzle